include("cl_player.lua")
include( 'player_class/player_quake.lua' )
GM.Name 	= "quake"
GM.Author 	= "|Royal|"
GM.Email 	= ".."
GM.Website 	= ""


BOOL = true
EF_AWARD_NONE   =     0
EF_TELEPORT_BIT =     1		// toggled every time the origin abruptly changes
EF_AWARD_EXCELLENT =  2		// draw an excellent sprite
EF_PLAYER_EVENT =     3
EF_BOUNCE =           4		// for missiles
EF_BOUNCE_HALF =      5		// for missiles
EF_AWARD_GAUNTLET =   6		// draw a gauntlet sprite
EF_NODRAW =           7		// may have an event, but no model (unspawned items)
EF_FIRING =           8		// for lightning gun
EF_KAMIKAZE =         9
EF_MOVER_STOP =       10		// will push otherwise
EF_AWARD_CAP =        11		// draw the capture sprite
EF_TALK =             12		// draw a talk balloon
EF_CONNECTION =       13		// draw a connection trouble sprite
EF_VOTED =            14		// already cast a vote
EF_AWARD_IMPRESSIVE = 15		// draw an impressive sprite
EF_AWARD_DEFEND =     16		// draw a defend sprite
EF_AWARD_ASSIST =     17		// draw a assist sprite
EF_AWARD_DENIED =     18		// denied
EF_TEAMVOTED =        19
CARNAGE_REWARD_TIME = 3
REWARD_SPRITE_TIME =  5
BONE_HEAD			= "ValveBiped.Bip01_Head1"
BONE_SPINE			= "ValveBiped.Bip01_Spine"
BONE_RIGHT_HAND		= "ValveBiped.Bip01_R_Hand"
BONE_RIGHT_FOREARM	= "ValveBiped.Bip01_R_Forearm"
BONE_RIGHT_FOOT		= "ValveBiped.Bip01_R_Foot"
BONE_RIGHT_THIGH	= "ValveBiped.Bip01_R_Thigh"
BONE_RIGHT_CALF		= "ValveBiped.Bip01_R_Calf"
BONE_RIGHT_SHOULDER = "ValveBiped.Bip01_R_Shoulder"
BONE_RIGHT_ELBOW	= "ValveBiped.Bip01_R_Elbow"
//catched from gmdm redux 
HumanGibs = {}

	table.insert( HumanGibs, "models/gibs/antlion_gib_medium_2.mdl" )
	table.insert( HumanGibs, "models/gibs/Antlion_gib_Large_1.mdl" )
	//table.insert( HumanGibs, "models/gibs/gunship_gibs_eye.mdl" )
	table.insert( HumanGibs, "models/gibs/Strider_Gib4.mdl" )
	table.insert( HumanGibs, "models/gibs/HGIBS.mdl" )
	table.insert( HumanGibs, "models/gibs/HGIBS_rib.mdl" )
	table.insert( HumanGibs, "models/gibs/HGIBS_scapula.mdl" )
	table.insert( HumanGibs, "models/gibs/HGIBS_spine.mdl" )


	for k, v in pairs( HumanGibs ) do
		util.PrecacheModel( v )
	end


--[[
Delay
--]]
/*


Jumps
// Mitte
POS = -1629, 3059, 3363.5
ANG = 271, 211, 0

POS = -1629, 3139.07, 3340.36
ANG = 308, 90, 0

POS = -1548.96, 3059, 3340.36
ANG = 333, 360, 0

POS = -1629, 2978.93, 3340.36
ANG = 327, 269, 0

POS = -1709.04, 3059, 3340.36
ANG = 316, 179, 0
// EBENE links
POS = -2200 3159.5 3505.5
ANG = 306 117 0
// EBENE links
//Runde
POS = -2200, 3159.5, 3505.5
ANG =
//Runde
POS = -1063, 3132, 3504
ANG =

POS = 
ANG =

POS = 
ANG =

Health 1
-1217.929932 2790.443115 3286.031250

Health 2
-2050.093262 2793.677490 3286.031250

Health 3
-2054.196533 3352.735107 3286.031250

Health 4
-1207.524902 3341.047119 3286.031250

Health 5
-1811.485474 913.423950 3387.031250

Health 6
-1458.932251 913.028931 3387.031250

RailGun
-1640.570313 938.805420 3387.031250

Railgunammo 1
Vector(-1718.719727 ,2165.856201, 3286.031250)

Railgunammo 2
-1539.006592 2151.865479 3286.031250

RedArmor
-1629.082764 2473.909668 3497.031250

RocketLuncher 1
-2058.461670 2779.044189 3497.031250

RocketLuncherammo 1
-2051.022217 2716.922119 3497.031250

RocketLuncherammo 2
-1218.684814 2702.071533 3497.031250

RocketLuncher 2
-1214.938965 2784.521973 3497.031250

Pumpgun1
-316.190399 3742.953613 3712.031250

Pumpgunammo 1
-388.055023 3743.531982 3712.031250

pumpgun2
-2974.522461 3774.679199 3712.031250

pumpgunammo 2
-2971.990479 3717.869141 3712.031250

Quake quad
-1623.829224 3152.312256 4157.031250
*/
function GM:Delay(value)
	v = value / 2	
	val = string.Explode( ".", tostring(v) )
	if( #val > 1 ) then
		return true
	elseif( #val == 1) then
		return false
	end
end

--[[---------------------------------------------------------
   Name: gamemode:PlayerHurt( )
   Desc: Called when a player is hurt.
-----------------------------------------------------------]]
function GM:PlayerHurt( player, attacker, healthleft, healthtaken )
end


--[[---------------------------------------------------------
   Name: gamemode:KeyPress( )
   Desc: Player pressed a key (see IN enums)
-----------------------------------------------------------]]
function GM:KeyPress( player, key )
end


--[[---------------------------------------------------------
   Name: gamemode:KeyRelease( )
   Desc: Player released a key (see IN enums)
-----------------------------------------------------------]]
function GM:KeyRelease( player, key )
end


--[[---------------------------------------------------------
   Name: gamemode:PlayerConnect( )
   Desc: Player has connects to the server (hasn't spawned)
-----------------------------------------------------------]]
function GM:PlayerConnect( name, address )
end

--[[---------------------------------------------------------
   Name: gamemode:PlayerAuthed( )
   Desc: Player's STEAMID has been authed
-----------------------------------------------------------]]
function GM:PlayerAuthed( ply, SteamID, UniqueID )
end



--[[---------------------------------------------------------
   Name: gamemode:PropBreak( )
   Desc: Prop has been broken
-----------------------------------------------------------]]
function GM:PropBreak( attacker, prop )
end


--[[---------------------------------------------------------
   Name: gamemode:PhysgunPickup( )
   Desc: Return true if player can pickup entity
-----------------------------------------------------------]]
function GM:PhysgunPickup( ply, ent )

	-- Don't pick up players
	if ( ent:GetClass() == "player" ) then return false end

	return true
end


--[[---------------------------------------------------------
   Name: gamemode:PhysgunDrop( )
   Desc: Dropped an entity
-----------------------------------------------------------]]
function GM:PhysgunDrop( ply, ent )
end


--[[---------------------------------------------------------
   Name: gamemode:SetupMove( player, movedata )
   Desc: Allows us to change stuff before the engine 
		  processes the movements
-----------------------------------------------------------]]
function GM:SetupMove( ply, move )
end


--[[---------------------------------------------------------
   Name: gamemode:FinishMove( player, movedata )
-----------------------------------------------------------]]
function GM:FinishMove( ply, move )

end

--[[---------------------------------------------------------
   Name: gamemode:Move
   This basically overrides the NOCLIP, PLAYERMOVE movement stuff.
   It's what actually performs the move. 
   Return true to not perform any default movement actions. (completely override)
-----------------------------------------------------------]]
function GM:Move( ply, mv )
end

--[[---------------------------------------------------------
   Name: gamemode:PlayerShouldTakeDamage
   Return true if this player should take damage from this attacker
-----------------------------------------------------------]]
function GM:PlayerShouldTakeDamage( ply, attacker )
	return true
end

--[[---------------------------------------------------------
   Name: gamemode:ContextScreenClick(  aimvec, mousecode, pressed, ply )
   'pressed' is true when the button has been pressed, false when it's released
-----------------------------------------------------------]]
function GM:ContextScreenClick( aimvec, mousecode, pressed, ply )
	

	
end

--[[---------------------------------------------------------
   Name: Text to show in the server browser
-----------------------------------------------------------]]
function GM:GetGameDescription()
	return self.Name
end


--[[---------------------------------------------------------
   Name: Saved
-----------------------------------------------------------]]
function GM:Saved()
end


--[[---------------------------------------------------------
   Name: Restored
-----------------------------------------------------------]]
function GM:Restored()
end


--[[---------------------------------------------------------
   Name: EntityRemoved
   Desc: Called right before an entity is removed. Note that this
   isn't going to be totally reliable on the client since the client
   only knows about entities that it has had in its PVS.
-----------------------------------------------------------]]
function GM:EntityRemoved( ent )
end


--[[---------------------------------------------------------
   Name: Tick
   Desc: Like Think except called every tick on both client and server
-----------------------------------------------------------]]
function GM:Tick()
end

--[[---------------------------------------------------------
   Name: OnEntityCreated
   Desc: Called right after the Entity has been made visible to Lua
-----------------------------------------------------------]]
function GM:OnEntityCreated( Ent )
end

--[[---------------------------------------------------------
   Name: gamemode:EntityKeyValue( ent, key, value )
   Desc: Called when an entity has a keyvalue set
	      Returning a string it will override the value
-----------------------------------------------------------]]
function GM:EntityKeyValue( ent, key, value )
end

--[[---------------------------------------------------------
   Name: gamemode:CreateTeams()
   Desc: Note - HAS to be shared.
-----------------------------------------------------------]]
function GM:CreateTeams()

	-- Don't do this if not teambased. But if it is teambased we
	-- create a few teams here as an example. If you're making a teambased
	-- gamemode you should override this function in your gamemode
	if ( !GAMEMODE.TeamBased ) then return end
	
	TEAM_BLUE = 1
	team.SetUp( TEAM_BLUE, "Blue Team", Color( 0, 0, 255 ) )
	team.SetSpawnPoint( TEAM_BLUE, "ai_hint" ) -- <-- This would be info_terrorist or some entity that is in your map
	
	TEAM_ORANGE = 2
	team.SetUp( TEAM_ORANGE, "Orange Team", Color( 255, 150, 0 ) )
	team.SetSpawnPoint( TEAM_ORANGE, "sky_camera" ) -- <-- This would be info_terrorist or some entity that is in your map
	
	TEAM_SEXY = 3
	team.SetUp( TEAM_SEXY, "Sexy Team", Color( 255, 150, 150 ) )
	team.SetSpawnPoint( TEAM_SEXY, "info_player_start" ) -- <-- This would be info_terrorist or some entity that is in your map
	
	team.SetSpawnPoint( TEAM_SPECTATOR, "worldspawn" ) 

end


--[[---------------------------------------------------------
   Name: gamemode:ShouldCollide( Ent1, Ent2 )
   Desc: This should always return true unless you have 
		  a good reason for it not to.
-----------------------------------------------------------]]
function GM:ShouldCollide( Ent1, Ent2 )
	return true
end
